import rss, { pagesGlobToRssItems } from '@astrojs/rss';

// 访问 http://localhost:4321/rss.xml
export async function GET(context) {
  return rss({
    title: 'Astro Learner | Blog',
    description: 'My journey learning Astro',
    site: context.site,// site在astro.config.mjs配置文件中自定义
    items: await pagesGlobToRssItems(import.meta.glob('./**/*.md')),
    customData: `<language>en-us</language>`,
    // customData: `<language>zh-CN</language>`,
  });
}